<template>
	<view class="set_wrap">
		<view  class="content">
			<set-list v-for="item in setList" :key="item.id" @changeFunc="changeFunc(item.id)" :item="item"></set-list>
			<u-modal :show="exitShow"  @cancel="exitShow = false" @confirm="exit" :showCancelButton="true" confirmColor="var(--echo-main-color)" title="退出登录" content="确认退出?"></u-modal>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				exitShow:false,
				setList:[{
					id:'0',
					title:'头像',
					info:'../../static/img/logo.png',
					type:'img',
				},{
					id:'1',
					title:'昵称',
					info:'哈',
				},{
					id:'2',
					title:'手机号',
					info:'12345678901',
				},{
					id:'3',
					title:'支付宝账号',
					info:'12345678901',
				},{
					id:'4',
					title:'交易密码',
					info:'未设置',
					state:0,
				},{
					id:'5',
					title:'实名认证',
					info:'未认证',
					state:0,
				},{
					id:'6',
					title:'退出登录',
					info:'',
				},]
			}
		},
		methods:{
			// 退出
			exit() {
				uni.clearStorageSync();
				uni.navigateTo({
					url: "/pages/login/login"
				})
				// 清除积分
				this.hy_balance = 0
				this.yl_balance = 0
				this.hs_balance = 0
			},
			changeFunc(id){
				console.log(id)
				switch (id){
					case '0':
						break;
					case '1':
						break;
					case '2':
						break;
					case '3':
						break;
					case '4':
				uni.navigateTo({
					url: "/pages/set/transactionPassword"
				})
						break;
					case '5':
				uni.navigateTo({
					url: "/pages/set/identityVerification"
				})
						break;
					case '6':
					this.exitShow = true
						break;
					default:
						break;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.set_wrap {
		min-height: 100vh;
		background-color: var(--echo-main-page-bg-color);
		.content{
			margin: 15px;
			font-size: 14px;
		}
	}
</style>
